<?php
//添加自定义设置选项
function npcink_customize_register( $wp_customize ) {
    //给相关设置项目加小铅笔

    if ( isset( $wp_customize->selective_refresh ) ) {

    //One
    $wp_customize->selective_refresh->add_partial( 'npcink_sections_text_one', array(
        'selector'        => '.1-1',
        'render_callback' => 'lifet_customize_partial_npcink_sections_text_one',
    ) );

    //Two
        $wp_customize->selective_refresh->add_partial( 'npcink_sections_text_two', array(
            'selector'        => '.1-2',
            'render_callback' => 'lifet_customize_partial_npcink_sections_text_two',
        ) );
        
    

    //logo
        $wp_customize->selective_refresh->add_partial( 'npcink_sections_logo', array(
            'selector'        => '.1-3',
            'render_callback' => 'lifet_customize_partial_npcink_sections_logo',
        ) );
        

    }

    //-----------------------------------------------------------------------------
    //添加主题设置面板，ID = npcink_options
    $wp_customize->add_panel( 'npcink_options',
    array(
        'title' => __( '我是面板 - Npcink', 'npcink' ),
        'description' => __( 'Npcink首发，Muze原创', 'npcink' ),
        'priority'    => 30,
        'capabitity'  => 'edit_theme_options',
    ) );

    //添加文本设置节，ID = npcink_sections_text
    $wp_customize->add_section('npcink_sections_text',
    array(                
        'title'     => '节 - Npcink',
        'description' => '主题的文本设置',     
        'panel' => 'npcink_options',
    ) );

    //文字设置:one，ID = npcink_sections_text_one
    $wp_customize->add_setting('npcink_sections_text_one',
        array(
            'default' => '后台接口暂无开放',
        )
    );
    $wp_customize->add_control('npcink_sections_text_one',
        array(
            'label' => '后台接口暂无开放',
            'section' => 'npcink_sections_text',
            'type' => 'text',
        )
    );

    //文字设置:two，ID = npcink_sections_text_two
    $wp_customize->add_setting('npcink_sections_text_two',
        array(
            'default' => '模块接口',
        )
    );
    $wp_customize->add_control('npcink_sections_text_two',
        array(
            'label' => '后台接口暂无开放',
            'section' => 'npcink_sections_text',
            'type' => 'text',
        )
    );



    $wp_customize->add_setting('npcink_sections_logo',
        array(
            'default' => 'logo尺寸30*30',
        )
    );
    $wp_customize->add_control( new WP_Customize_Image_Control( 
        $wp_customize, 'npcink_sections_logo', 
        array(
            'label' => 'logo',
            'section' => 'npcink_sections_text'
        ) ) 
    );

}
add_action( 'customize_register', 'npcink_customize_register' );